package com.example.demo.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.demo.entity.RoleMenu;
import com.example.demo.entity.UserRole;
import com.example.demo.service.RoleMenuService;
import com.example.demo.mapper.RoleMenuMapper;
import org.springframework.stereotype.Service;

/**
* @author admin
* @description 针对表【role_menu(角色菜单表)】的数据库操作Service实现
* @createDate 2024-01-08 10:33:30
*/
@Service
public class RoleMenuServiceImpl extends ServiceImpl<RoleMenuMapper, RoleMenu> implements RoleMenuService{

    @Override
    public Integer deleteByRoleId(Long rid) {
        QueryWrapper<RoleMenu> queryWrapper=new QueryWrapper<>();
        queryWrapper.eq("rid",rid);
        return baseMapper.delete(queryWrapper);
    }

    @Override
    public Integer deleteByMenuId(Long mid) {
        QueryWrapper<RoleMenu> queryWrapper=new QueryWrapper<>();
        queryWrapper.eq("mid",mid);
        return baseMapper.delete(queryWrapper);
    }
}




